package com.xfcy.blog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xfcy.blog.entity.Comment;
import com.xfcy.blog.vo.ReplyCountVO;
import com.xfcy.blog.vo.ReplyVO;
import com.xfcy.blog.vo.SystemCommentVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 评论表(Comment)表数据库访问层
 *
 * @author 晓风残月Lx
 * @since 2023-04-09 11:03:05
 */
@Repository
public interface CommentMapper extends BaseMapper<Comment> {

    List<ReplyVO> listReplies(@Param("id") Integer id);

    ReplyCountVO listReplyCountByCommentId(@Param("id") Integer id);

    /**
     * 后端查询评论列表（包括逻辑删除的数据）
     *
     * @param objectPage
     * @param keywords
     * @return
     */
    Page<SystemCommentVO> listComment(@Param("page") Page<Object> objectPage, @Param("keywords") String keywords, @Param("isDeleted") Integer isDeleted);

    /**
     * 后端批量删除评论列表
     * @param ids
     */
    void deleteBatchComment(@Param("ids") List<Long> ids);
}

